package com.hnqcgc.service.impl;

import com.hnqcgc.dao.ICompanyDao;
import com.hnqcgc.dao.impl.CompanyDaolmpl;
import com.hnqcgc.db.MyTransaction;
import com.hnqcgc.service.ICompanyService;
import com.hnqcgc.vo.TCompany;

import java.sql.SQLException;
import java.util.List;

public class CompanyServicelmpl implements ICompanyService {
    MyTransaction myTransaction=new MyTransaction(true);
    ICompanyDao dao=new CompanyDaolmpl(myTransaction);

    @Override
    public List<TCompany> queryAll() {
        try {
            return dao.queryAll();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return null;
    }

    @Override
    public List<TCompany> queryByPage(int pagesize, int pagenum) {
        try {
            return dao.queryByPage(pagesize,pagenum);
        }catch (SQLException throwables){
            throwables.printStackTrace();
        }
        return null;
    }


}
